package archimede;

import java.io.File;

import javax.swing.filechooser.FileFilter;

public class FiltroPNG extends FileFilter {
	public boolean accept(File f) {
		if (f.isDirectory())
			return true;
		String extension = "";
		String s = f.getName();
		int i = s.lastIndexOf('.');
		if ((i > 0) && (i < s.length() - 1))
			extension = s.substring(i + 1).toLowerCase();
		if (extension != null) {
			return extension.equals("png");
		}
		return false;
	}

	public String getDescription() {
		return "Immagine PNG";
	}
}
